import request from '@/utils/request'


// 查询设备信息列表
export function listDevice(query) {
    return request({
        url: '/contract/device/list',
        method: 'get',
        params: query
    })
}

// 新增合同
export function addContract(data) {
    return request({
        url: '/contract/contract',
        method: 'post',
        data: data
    })
}

// 查询中标供应商信息
export function selectSuppHid(iNumber) {
    return request({
        url: '/contract/candidate/getSuppHid',
        method: 'get',
        params: {
            iNumber: iNumber
        }
    })
}

// 查询公共附件详细eid
export function getAttachments(eid) {
    return request({
        url: '/contract/contract/selectCom',
        method: 'get',
        params: {
            eid: eid
        }
    })
}

// 查询合同详细
export function getContract(eid) {
    return request({
        url: '/contract/contract/' + eid,
        method: 'get'
    })
}

// 查询合同内的产品信息
export function listInventory(query) {
    return request({
        url: '/contract/inventory/list',
        method: 'get',
        params: query
    })
}

// 查询支付约定列表
export function listPayment(query) {
    return request({
        url: '/contract/payment/list',
        method: 'get',
        params: query
    })
}

// 查询签署执行状态列表
export function SelectSign(query) {
    return request({
        url: '/contract/sign/list1',
        method: 'get',
        params: query
    })
}

// 修改合同
export function updateContract(data) {
    return request({
        url: '/contract/contract',
        method: 'put',
        data: data
    })
}

// 删除合同
export function delContract(eid) {
    return request({
        url: '/contract/contract/del',
        method: 'get',
        params: {
            eid: eid
        }
    })
}

// 合同作废
export function HtCancel(data) {
    return request({
        url: '/contract/contract/HtCancel',
        method: 'put',
        data: data
    })
}

// 修改合同管理状态
export function updateoHstatus(data) {
    return request({
        url: '/contract/contract/updateoHstatus',
        method: 'put',
        data: data
    })
}

// 删除协议
export function delXy(oid) {
    return request({
        url: '/contract/management/delXy',
        method: 'get',
        params: {
            oid: oid
        }
    })
}

// 查询框架协议管理列表
export function listManagement(query) {
    return request({
        url: '/contract/management/list',
        method: 'get',
        params: query
    })
}

// 协议作废
export function XyCancel(oid) {
    return request({
        url: '/contract/management/XyCancel',
        method: 'get',
        params: {
            oid: oid
        }
    })
}

// 协议作废(修改oid)
export function XyCancelByOid(oid) {
    // return request({
    //     url: '/ppm/framework/XyCancel',
    //     method: 'get',
    //     params: {
    //         oid: oid
    //     }
    // })
}

// 新增框架协议管理
export function addManagement(data) {
    return request({
        url: '/contract/management',
        method: 'post',
        data: data
    })
}

// 查询框架计划内的设备信息
export function selectItemsDevice(jhId) {
    return request({
        url: '/contract/items/selectItemsDevice',
        method: 'get',
        params: jhId
    })
}

// 修改框架计划oid
export function upOidbyOid(data) {
    return request({
        url: '/contract/framework/updateOidByPlanId',
        method: 'put',
        data: data
    })
}

// 查询框架协议管理详细
export function getManagement(oid) {
  return request({
    url: '/contract/management/' + oid,
    method: 'get'
  })
}

// 修改框架协议管理
export function updateManagement(data) {
  return request({
    url: '/contract/management',
    method: 'put',
    data: data
  })
}
